--[[
	
	Name: Ultimate Blacklist
	By: Crypton

]]
UBL_DEBUG = false;

function UBLErrorDetect_OnLoad(this)
	this:RegisterEvent("VARIABLES_LOADED");
	this:RegisterEvent("SCRIPT_RUNTIME_ERROR");
end

function UBLErrorDetect_OnEvent(this, event)
	if (event == "VARIABLES_LOADED") then
		UBL_BUGS = {};
	elseif (event == "SCRIPT_RUNTIME_ERROR") then
		if (string.find(arg1, "%sUBL(.+)")) then
			if (UBL_BUGS == nil) then
				UBL_BUGS = {};
			end
			BugMessageFrame:Hide();
			table.insert(UBL_BUGS, arg1);
			SaveVariables("UBL_BUGS");
			if (UBL_DEBUG) then
				DEFAULT_CHAT_FRAME:AddMessage("|cFFffffffUltimate Blacklist Error:|r "..arg1);
			end
		end
	end
end
